SHELL = /bin/sh

host_alias = i386
host_triplet = i386-pc-none
CC = arm-linux-gcc
LN_S = ln -s
OBJCOPY = arm-linux-objcopy
OCFLAGS = -O binary -R .note -R .comment -S
PACKAGE = tynux_bl
VERSION = 0.1


# WARNING: start.S *must* be the first file, otherwise the target will
# be linked in the wrong order!

MDOC_SOURCES= bch_hm.c blockdev.c docbdk.c docsoc.c docsys.c
MDOC_SOURCES+= dosformt.c flbase.c flcustom.c flflash.c flioctl.c
MDOC_SOURCES+= flparse.c flsocket.c flsocket.c flsystem.c fltl.c
MDOC_SOURCES+= m512_lgc.c m512_mtd.c matchalg.c mtdsa.c saftl.c


MDOC_LDFLAGS =  -r

#INCLUDES =  -I. -I../../include -I../../../kernel/include -I/usr/local/arm-linux/arm-linux/include \
#		-I/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.2.1/include
INCLUDES =  -I. -I../../include


DEFS =
CPPFLAGS =
LDFLAGS = -static -nostdlib
LIBS =


MDOC_OBJECTS= bch_hm.o blockdev.o docbdk.o docsoc.o docsys.o
MDOC_OBJECTS+= dosformt.o flbase.o flcustom.o flflash.o flioctl.o
MDOC_OBJECTS+= flparse.o flsocket.o flsystem.o fltl.o
MDOC_OBJECTS+= m512_lgc.o m512_mtd.o matchalg.o mtdsa.o saftl.o

MDOC_DEPENDENCIES =
MDOC_LDADD = $(LDADD)

CFLAGS =  -O2 -g $(INCLUDES) -Wall -nostdinc -mcpu=xscale -mtune=xscale -fomit-frame-pointer -fPIC
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@

SOURCES = $(MDOC_SOURCES) $(MDOC_SOURCES)
OBJECTS = $(MDOC_OBJECTS) $(MDOC_OBJECTS)

all: tffs.o

#.c.o:
#        $(COMPILE) -c $<


tffs.o: $(MDOC_OBJECTS) $(MDOC_DEPENDENCIES)
	$(LINK) $(MDOC_LDFLAGS) $(MDOC_OBJECTS) $(MDOC_LDADD) $(LIBS)


clean :
	-del *.o


